package com.epta.common;

import java.util.EnumSet;

/**
 * Created by Administrator on 2017/11/1 0001.
 */
public enum AchievementType {

    PAPER(1,"论文"),
    PATENT(2,"专利");

    private int code;
    private String value;
    AchievementType(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public int getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static String getValue(int code){
        for(AchievementType achievementType : EnumSet.allOf(AchievementType.class)){
            if(achievementType.getCode() == code){
                return achievementType.getValue();
            }
        }
        return null;
    }
}
